﻿@model Windshield.ViewModels.BoardTableViewModel


<!-- TODO: make it so the whole row is clickable -->

@if (Model.IsEmpty)
{
	<p class="lead">
		Sorry!
	</p>
	<p>
		There are no boards to be displayed for this game.
	</p>
}
else
{
<table class="table table-hover" data-provides="rowlink">

	<thead>
		<tr>
			<th class="span5">
				Game
			</th>
			<th class="span5">
				Owner
			</th>
			<th class="span2">
				Players
			</th>
			
		</tr>
	</thead>

	<tbody class="cursor-pointer">
		@foreach (var row in Model.Rows)
		{
		<tr>
			<td class="span5">
				@Html.ActionLink(row.GameName, "JoinBoard", "Games", new {idBoard = @row.ID}, null)
			</td>
			<td class="span5">
				@row.OwnerName
			</td>
			<td class="span2">
				@row.Players / @row.MaxPlayers
			</td>
		</tr>
		}	
	</tbody>

</table>
}